{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "initial_id",
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    ""
   ]
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-15T03:25:02.835722Z",
     "start_time": "2025-09-15T03:25:02.570691Z"
    }
   },
   "cell_type": "code",
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "from datetime import datetime, timedelta\n",
    "import json\n",
    "\n",
    "# 设置随机种子以保证结果可重现\n",
    "np.random.seed(42)\n",
    "\n",
    "# 1. 基础配置和共享数据\n",
    "semesters = [f\"{year}-{term}\" for year in range(2021, 2024) for term in ['Spring', 'Fall']]\n",
    "colleges = {\n",
    "    'CS': 'Computer Science',\n",
    "    'EE': 'Electronic Engineering',\n",
    "    'MA': 'Mathematics',\n",
    "    'PH': 'Physics',\n",
    "    'CH': 'Chemistry'\n",
    "}\n",
    "majors = {\n",
    "    'CS01': 'Computer Science',\n",
    "    'EE02': 'Electronic Engineering',\n",
    "    'MA03': 'Mathematics',\n",
    "    'PH04': 'Physics',\n",
    "    'CH05': 'Chemistry'\n",
    "}\n",
    "course_types = ['Theory', 'Lab', 'Elective']\n",
    "teacher_titles = ['Professor', 'Associate Professor', 'Lecturer', 'Assistant Professor']\n",
    "\n",
    "# 生成教师ID和基本信息\n",
    "num_teachers = 50\n",
    "teacher_ids = [f\"T{1000 + i}\" for i in range(num_teachers)]\n",
    "teacher_base_info = []\n",
    "for tid in teacher_ids:\n",
    "    teacher_base_info.append({\n",
    "        'teacher_id': tid,\n",
    "        'title': np.random.choice(teacher_titles, p=[0.2, 0.3, 0.4, 0.1]),\n",
    "        'years_of_experience': np.random.randint(1, 31),\n",
    "        'has_phd': np.random.choice([1, 0], p=[0.7, 0.3]),\n",
    "        'college_id': np.random.choice(list(colleges.keys()))\n",
    "    })\n",
    "\n",
    "# 生成学生ID\n",
    "num_students = 200\n",
    "student_ids = [f\"S{10000 + i}\" for i in range(num_students)]\n",
    "\n",
    "# 生成课程ID\n",
    "num_courses = 40\n",
    "course_ids = [f\"C{100 + i}\" for i in range(num_courses)]\n",
    "\n",
    "# 2. 生成【教学质量分析】相关数据\n",
    "print(\"生成教学质量分析数据...\")\n",
    "\n",
    "# 2.1 各学期教学评价指标及增长率\n",
    "def generate_teaching_evaluation_data(semesters):\n",
    "    data = []\n",
    "    base_satisfaction = 4.2\n",
    "    base_employment = 0.90\n",
    "\n",
    "    for i, sem in enumerate(semesters):\n",
    "        trend = 0.02 * (i / 2)  # 缓慢上升趋势\n",
    "        fluctuation = np.random.uniform(-0.03, 0.03)\n",
    "\n",
    "        avg_sat = round(base_satisfaction + trend + fluctuation, 2)\n",
    "        emp_rate = round(base_employment + trend + fluctuation, 2)\n",
    "\n",
    "        avg_sat = np.clip(avg_sat, 4.0, 4.8)\n",
    "        emp_rate = np.clip(emp_rate, 0.85, 0.98)\n",
    "\n",
    "        sat_growth = (avg_sat - data[-1]['avg_satisfaction']) / data[-1]['avg_satisfaction'] if i > 0 else np.nan\n",
    "        emp_growth = (emp_rate - data[-1]['employment_rate']) / data[-1]['employment_rate'] if i > 0 else np.nan\n",
    "\n",
    "        data.append({\n",
    "            'semester': sem,\n",
    "            'avg_satisfaction': avg_sat,\n",
    "            'satisfaction_growth_rate': round(sat_growth, 4) if not np.isnan(sat_growth) else None,\n",
    "            'employment_rate': emp_rate,\n",
    "            'employment_growth_rate': round(emp_growth, 4) if not np.isnan(emp_growth) else None,\n",
    "            'excellent_course_ratio': round(np.random.uniform(0.15, 0.25), 3),\n",
    "            'avg_pass_rate': round(np.random.uniform(0.88, 0.96), 3)\n",
    "        })\n",
    "    return pd.DataFrame(data)\n",
    "\n",
    "df_teaching_eval = generate_teaching_evaluation_data(semesters)\n",
    "\n",
    "# 2.2 课程通过率与优秀率数据\n",
    "course_pass_excellent_data = []\n",
    "for sem in semesters:\n",
    "    for major_id, major_name in majors.items():\n",
    "        course_pass_excellent_data.append({\n",
    "            'semester': sem,\n",
    "            'major_id': major_id,\n",
    "            'major_name': major_name,\n",
    "            'avg_pass_rate': round(np.random.uniform(0.85, 0.98), 3),\n",
    "            'avg_excellent_rate': round(np.random.uniform(0.10, 0.35), 3)\n",
    "        })\n",
    "\n",
    "df_course_pass_excellent = pd.DataFrame(course_pass_excellent_data)\n",
    "\n",
    "# 2.3 各学院教学满意度评分\n",
    "college_satisfaction_data = []\n",
    "for college_id, college_name in colleges.items():\n",
    "    for sem in semesters:\n",
    "        college_satisfaction_data.append({\n",
    "            'semester': sem,\n",
    "            'college_id': college_id,\n",
    "            'college_name': college_name,\n",
    "            'satisfaction_score': round(np.random.uniform(3.8, 4.7), 2)\n",
    "        })\n",
    "\n",
    "df_college_satisfaction = pd.DataFrame(college_satisfaction_data)\n",
    "\n",
    "# 2.4 不同专业就业率对比\n",
    "employment_rate_data = []\n",
    "for major_id, major_name in majors.items():\n",
    "    employment_rate_data.append({\n",
    "        'major_id': major_id,\n",
    "        'major_name': major_name,\n",
    "        'employment_rate': round(np.random.uniform(0.87, 0.97), 3),\n",
    "        'major_match_rate': round(np.random.uniform(0.70, 0.90), 3)\n",
    "    })\n",
    "\n",
    "df_employment_rate = pd.DataFrame(employment_rate_data)\n",
    "\n",
    "# 2.5 历年教学评价指标及影响因素数据 (用于预测)\n",
    "teaching_evaluation_factors_data = []\n",
    "for sem in semesters:\n",
    "    for i in range(20):  # 20条记录每学期\n",
    "        teacher_exp = np.random.randint(1, 31)\n",
    "        training_count = np.random.randint(0, 6)\n",
    "        phd_bonus = 0.2 if np.random.random() > 0.5 else 0\n",
    "\n",
    "        # 模拟教学评价得分与教师经验、培训次数等因素的关系\n",
    "        base_score = 3.5 + (teacher_exp * 0.03) + (training_count * 0.1) + phd_bonus\n",
    "        noise = np.random.normal(0, 0.2)\n",
    "        teaching_score = round(np.clip(base_score + noise, 3.0, 5.0), 2)\n",
    "\n",
    "        teaching_evaluation_factors_data.append({\n",
    "            'semester': sem,\n",
    "            'teacher_exp': teacher_exp,\n",
    "            'training_count': training_count,\n",
    "            'has_phd': 1 if phd_bonus > 0 else 0,\n",
    "            'student_teacher_ratio': np.random.randint(15, 26),\n",
    "            'funding_per_student': np.random.uniform(5000, 15000),\n",
    "            'teaching_score': teaching_score\n",
    "        })\n",
    "\n",
    "df_teaching_evaluation_factors = pd.DataFrame(teaching_evaluation_factors_data)\n",
    "\n",
    "# 3. 生成【学生学业分析】相关数据\n",
    "print(\"生成学生学业分析数据...\")\n",
    "\n",
    "# 3.1 各年级学生成绩分布数据\n",
    "grade_distribution_data = []\n",
    "for sem in semesters:\n",
    "    for grade in ['Freshman', 'Sophomore', 'Junior', 'Senior']:\n",
    "        grade_distribution_data.append({\n",
    "            'semester': sem,\n",
    "            'grade': grade,\n",
    "            'avg_score': round(np.random.uniform(70, 88), 1),\n",
    "            'score_std': round(np.random.uniform(8, 15), 1)\n",
    "        })\n",
    "\n",
    "df_grade_distribution = pd.DataFrame(grade_distribution_data)\n",
    "\n",
    "# 3.2 课程选修人数与评分数据\n",
    "course_enrollment_data = []\n",
    "for cid in course_ids:\n",
    "    enrollment = np.random.randint(30, 150)\n",
    "    rating = round(np.random.uniform(3.5, 4.8), 1)\n",
    "    difficulty = round(np.random.uniform(2.5, 4.5), 1)\n",
    "\n",
    "    course_enrollment_data.append({\n",
    "        'course_id': cid,\n",
    "        'course_name': f\"Course_{cid}\",\n",
    "        'enrollment_count': enrollment,\n",
    "        'avg_rating': rating,\n",
    "        'avg_difficulty': difficulty,\n",
    "        'course_type': np.random.choice(course_types)\n",
    "    })\n",
    "\n",
    "df_course_enrollment = pd.DataFrame(course_enrollment_data)\n",
    "\n",
    "# 3.3 学生出勤率与成绩相关性\n",
    "student_attendance_data = []\n",
    "for sid in student_ids:\n",
    "    for i in range(np.random.randint(4, 7)):  # 每个学生选4-6门课\n",
    "        cid = np.random.choice(course_ids)\n",
    "\n",
    "        # 创建正相关性：出勤率越高，成绩大概率越高\n",
    "        base_attendance = np.random.normal(0.85, 0.1)\n",
    "        base_attendance = np.clip(base_attendance, 0.5, 1.0)\n",
    "\n",
    "        # 成绩受出勤率影响，并加入随机噪声\n",
    "        score = 60 + (base_attendance * 40) + np.random.normal(0, 5)\n",
    "        score = np.clip(score, 50, 100)\n",
    "\n",
    "        student_attendance_data.append({\n",
    "            'student_id': sid,\n",
    "            'course_id': cid,\n",
    "            'attendance_rate': round(base_attendance, 2),\n",
    "            'final_score': round(score),\n",
    "            'course_type': np.random.choice(['Compulsory', 'Elective'], p=[0.7, 0.3])\n",
    "        })\n",
    "\n",
    "df_student_attendance = pd.DataFrame(student_attendance_data)\n",
    "\n",
    "# 3.4 学生历史成绩及行为特征数据 (用于成绩预测)\n",
    "student_historical_data = []\n",
    "for sid in student_ids:\n",
    "    prev_avg = np.random.normal(75, 10)\n",
    "    prev_avg = np.clip(prev_avg, 60, 95)\n",
    "\n",
    "    attendance_avg = np.random.normal(0.85, 0.1)\n",
    "    attendance_avg = np.clip(attendance_avg, 0.6, 1.0)\n",
    "\n",
    "    library_visits = np.random.poisson(3)\n",
    "    activity_participation = np.random.randint(1, 6)\n",
    "\n",
    "    # 根据特征计算成绩概率\n",
    "    score_prob = 0.3*(prev_avg/100) + 0.3*attendance_avg + 0.2*(library_visits/10) + 0.2*(activity_participation/5)\n",
    "    score_prob += np.random.normal(0, 0.1)\n",
    "\n",
    "    # 将概率映射到成绩等级\n",
    "    if score_prob > 0.8:\n",
    "        grade = \"A\"\n",
    "    elif score_prob > 0.65:\n",
    "        grade = \"B\"\n",
    "    elif score_prob > 0.5:\n",
    "        grade = \"C\"\n",
    "    else:\n",
    "        grade = \"D\"\n",
    "\n",
    "    student_historical_data.append({\n",
    "        'student_id': sid,\n",
    "        'previous_avg_score': round(prev_avg, 1),\n",
    "        'attendance_rate_avg': round(attendance_avg, 2),\n",
    "        'library_visits_per_week': library_visits,\n",
    "        'participation_in_activities': activity_participation,\n",
    "        'has_scholarship': np.random.choice([1, 0], p=[0.2, 0.8]),\n",
    "        'current_score_grade': grade\n",
    "    })\n",
    "\n",
    "df_student_historical = pd.DataFrame(student_historical_data)\n",
    "\n",
    "# 3.5 学生学术活动参与数据\n",
    "academic_activities = ['Research', 'Competition', 'Conference', 'Project', 'Internship']\n",
    "academic_participation_data = []\n",
    "for major_id in majors.keys():\n",
    "    for activity in academic_activities:\n",
    "        academic_participation_data.append({\n",
    "            'major_id': major_id,\n",
    "            'activity_type': activity,\n",
    "            'participation_rate': round(np.random.uniform(0.1, 0.5), 3),\n",
    "            'avg_achievement_level': round(np.random.uniform(2.5, 4.5), 1)\n",
    "        })\n",
    "\n",
    "df_academic_participation = pd.DataFrame(academic_participation_data)\n",
    "\n",
    "# 4. 生成【课程资源分析】相关数据\n",
    "print(\"生成课程资源分析数据...\")\n",
    "\n",
    "# 4.1 各学期课程开设数量与容量\n",
    "course_capacity_data = []\n",
    "for sem in semesters:\n",
    "    for ctype in course_types:\n",
    "        courses_opened = np.random.randint(10, 30 if ctype == 'Theory' else 20)\n",
    "        avg_capacity = np.random.randint(20, 100 if ctype == 'Theory' else 40)\n",
    "\n",
    "        course_capacity_data.append({\n",
    "            'semester': sem,\n",
    "            'course_type': ctype,\n",
    "            'courses_opened': courses_opened,\n",
    "            'total_capacity': courses_opened * avg_capacity,\n",
    "            'avg_capacity_per_course': avg_capacity\n",
    "        })\n",
    "\n",
    "df_course_capacity = pd.DataFrame(course_capacity_data)\n",
    "\n",
    "# 4.2 教学资源分配情况\n",
    "resource_allocation_data = []\n",
    "for college_id in colleges.keys():\n",
    "    resource_allocation_data.append({\n",
    "        'college_id': college_id,\n",
    "        'college_name': colleges[college_id],\n",
    "        'teacher_count': np.random.randint(15, 40),\n",
    "        'classroom_count': np.random.randint(10, 25),\n",
    "        'lab_capacity': np.random.randint(200, 500),\n",
    "        'funding_allocation': np.random.randint(100000, 500000)\n",
    "    })\n",
    "\n",
    "df_resource_allocation = pd.DataFrame(resource_allocation_data)\n",
    "\n",
    "# 4.3 历年课程选课数据及影响因素 (用于需求预测)\n",
    "course_demand_data = []\n",
    "base_year = 2020\n",
    "for i, sem in enumerate(semesters):\n",
    "    year = int(sem.split('-')[0])\n",
    "    semester_num = 1 if 'Spring' in sem else 2\n",
    "\n",
    "    for cid in course_ids:\n",
    "        # 创建一些趋势：热门课程越来越热门\n",
    "        popularity_trend = 1.0 + (0.1 * (year - base_year))\n",
    "\n",
    "        # 教师评分影响\n",
    "        teacher_effect = np.random.uniform(0.8, 1.2)\n",
    "\n",
    "        # 课程难度影响\n",
    "        difficulty_effect = 1.0 - (np.random.uniform(0.1, 0.3) if np.random.random() > 0.7 else 0)\n",
    "\n",
    "        # 计算需求\n",
    "        base_demand = np.random.randint(30, 100)\n",
    "        demand = round(base_demand * popularity_trend * teacher_effect * difficulty_effect)\n",
    "\n",
    "        course_demand_data.append({\n",
    "            'semester': sem,\n",
    "            'course_id': cid,\n",
    "            'teacher_rating': round(teacher_effect * 4.0, 1),\n",
    "            'course_difficulty': round(1.0/difficulty_effect, 1),\n",
    "            'predicted_demand': demand,\n",
    "            'actual_enrollment': demand + np.random.randint(-10, 10)\n",
    "        })\n",
    "\n",
    "df_course_demand = pd.DataFrame(course_demand_data)\n",
    "\n",
    "# 4.4 教材使用频率与评价\n",
    "textbook_data = []\n",
    "for i in range(60):  # 60种教材\n",
    "    textbook_data.append({\n",
    "        'textbook_id': f\"TB{1000 + i}\",\n",
    "        'textbook_name': f\"Textbook {i+1}\",\n",
    "        'usage_count': np.random.randint(5, 50),\n",
    "        'avg_rating': round(np.random.uniform(3.0, 4.8), 1),\n",
    "        'price': round(np.random.uniform(30, 150), 2)\n",
    "    })\n",
    "\n",
    "df_textbook = pd.DataFrame(textbook_data)\n",
    "\n",
    "# 4.5 实验设备利用率数据\n",
    "equipment_utilization_data = []\n",
    "equipment_types = ['Microscope', 'Spectrometer', 'Oscilloscope', 'Centrifuge', '3D_Printer']\n",
    "time_slots = ['8-10', '10-12', '12-14', '14-16', '16-18']\n",
    "\n",
    "for eq_type in equipment_types:\n",
    "    for slot in time_slots:\n",
    "        equipment_utilization_data.append({\n",
    "            'equipment_type': eq_type,\n",
    "            'time_slot': slot,\n",
    "            'utilization_rate': round(np.random.uniform(0.2, 0.9), 2)\n",
    "        })\n",
    "\n",
    "df_equipment_utilization = pd.DataFrame(equipment_utilization_data)\n",
    "\n",
    "# 5. 生成【师资结构分析】相关数据\n",
    "print(\"生成师资结构分析数据...\")\n",
    "\n",
    "# 5.1 教师职称与年龄分布\n",
    "teacher_age_title_data = []\n",
    "for teacher in teacher_base_info:\n",
    "    # 年龄与职称相关\n",
    "    if teacher['title'] == 'Professor':\n",
    "        age = np.random.randint(45, 65)\n",
    "    elif teacher['title'] == 'Associate Professor':\n",
    "        age = np.random.randint(35, 50)\n",
    "    else:\n",
    "        age = np.random.randint(25, 40)\n",
    "\n",
    "    teacher_age_title_data.append({\n",
    "        'teacher_id': teacher['teacher_id'],\n",
    "        'title': teacher['title'],\n",
    "        'age': age,\n",
    "        'college_id': teacher['college_id']\n",
    "    })\n",
    "\n",
    "df_teacher_age_title = pd.DataFrame(teacher_age_title_data)\n",
    "\n",
    "# 5.2 教师教学工作量统计\n",
    "teacher_workload_data = []\n",
    "for teacher in teacher_base_info:\n",
    "    # 职称越高，教学工作量可能越少\n",
    "    if teacher['title'] == 'Professor':\n",
    "        hours = np.random.normal(120, 20)\n",
    "    elif teacher['title'] == 'Associate Professor':\n",
    "        hours = np.random.normal(160, 25)\n",
    "    else:\n",
    "        hours = np.random.normal(200, 30)\n",
    "\n",
    "    hours = np.clip(hours, 80, 250)\n",
    "\n",
    "    teacher_workload_data.append({\n",
    "        'teacher_id': teacher['teacher_id'],\n",
    "        'teaching_hours': int(hours),\n",
    "        'courses_taught': int(hours / 40 * np.random.uniform(0.8, 1.2)),\n",
    "        'student_count': int(hours * np.random.uniform(2, 4))\n",
    "    })\n",
    "\n",
    "df_teacher_workload = pd.DataFrame(teacher_workload_data)\n",
    "\n",
    "# 5.3 教师科研成果与教学评价\n",
    "teacher_research_teaching_data = []\n",
    "for teacher in teacher_base_info:\n",
    "    hours = next((item['teaching_hours'] for item in teacher_workload_data if item['teacher_id'] == teacher['teacher_id']), 0)\n",
    "\n",
    "    # 教学和科研之间创造微弱的负相关性\n",
    "    teaching_factor = hours / 250\n",
    "    papers = np.random.poisson(5 - (teaching_factor * 2))\n",
    "    projects = np.random.poisson(2 - (teaching_factor * 0.5))\n",
    "\n",
    "    # 教学评价与经验和培训相关\n",
    "    exp_bonus = teacher['years_of_experience'] * 0.02\n",
    "    training_bonus = np.random.randint(0, 6) * 0.1\n",
    "    teaching_score = 3.5 + exp_bonus + training_bonus + np.random.normal(0, 0.3)\n",
    "    teaching_score = np.clip(teaching_score, 3.0, 5.0)\n",
    "\n",
    "    teacher_research_teaching_data.append({\n",
    "        'teacher_id': teacher['teacher_id'],\n",
    "        'papers_published': papers,\n",
    "        'research_projects': projects,\n",
    "        'teaching_score': round(teaching_score, 2)\n",
    "    })\n",
    "\n",
    "df_teacher_research_teaching = pd.DataFrame(teacher_research_teaching_data)\n",
    "\n",
    "# 5.4 教师特征及历史教学评价数据 (用于预测)\n",
    "teacher_features_data = []\n",
    "for teacher in teacher_base_info:\n",
    "    age = next((item['age'] for item in teacher_age_title_data if item['teacher_id'] == teacher['teacher_id']), 0)\n",
    "    teaching_score = next((item['teaching_score'] for item in teacher_research_teaching_data if item['teacher_id'] == teacher['teacher_id']), 0)\n",
    "\n",
    "    teacher_features_data.append({\n",
    "        'teacher_id': teacher['teacher_id'],\n",
    "        'age': age,\n",
    "        'title': teacher['title'],\n",
    "        'years_of_experience': teacher['years_of_experience'],\n",
    "        'has_phd': teacher['has_phd'],\n",
    "        'training_count': np.random.randint(0, 6),\n",
    "        'papers_published': np.random.randint(0, 16),\n",
    "        'teaching_score': teaching_score\n",
    "    })\n",
    "\n",
    "df_teacher_features = pd.DataFrame(teacher_features_data)\n",
    "\n",
    "# 5.5 教师培训参与情况\n",
    "teacher_training_data = []\n",
    "training_programs = ['Pedagogy', 'Technology', 'Research Methods', 'Leadership', 'Diversity']\n",
    "for teacher in teacher_base_info:\n",
    "    for program in np.random.choice(training_programs, size=np.random.randint(0, 4), replace=False):\n",
    "        teacher_training_data.append({\n",
    "            'teacher_id': teacher['teacher_id'],\n",
    "            'training_program': program,\n",
    "            'completion_hours': np.random.randint(10, 30),\n",
    "            'satisfaction_score': round(np.random.uniform(3.5, 5.0), 1)\n",
    "        })\n",
    "\n",
    "df_teacher_training = pd.DataFrame(teacher_training_data)\n",
    "\n",
    "# 6. 保存所有数据到JSON文件\n",
    "print(\"保存数据到JSON文件...\")\n",
    "\n",
    "# 教学质量分析\n",
    "df_teaching_eval.to_json('各学期教学评价指标及增长率.json', orient='records', indent=2, force_ascii=False)\n",
    "df_course_pass_excellent.to_json('课程通过率与优秀率数据.json', orient='records', indent=2, force_ascii=False)\n",
    "df_college_satisfaction.to_json('各学院教学满意度评分.json', orient='records', indent=2, force_ascii=False)\n",
    "df_employment_rate.to_json('不同专业就业率对比.json', orient='records', indent=2, force_ascii=False)\n",
    "df_teaching_evaluation_factors.to_json('历年教学评价指标及影响因素数据.json', orient='records', indent=2, force_ascii=False)\n",
    "\n",
    "# 学生学业分析\n",
    "df_grade_distribution.to_json('各年级学生成绩分布数据.json', orient='records', indent=2, force_ascii=False)\n",
    "df_course_enrollment.to_json('课程选修人数与评分数据.json', orient='records', indent=2, force_ascii=False)\n",
    "df_student_attendance.to_json('学生出勤率与成绩相关性.json', orient='records', indent=2, force_ascii=False)\n",
    "df_student_historical.to_json('学生历史成绩及行为特征数据.json', orient='records', indent=2, force_ascii=False)\n",
    "df_academic_participation.to_json('学生学术活动参与数据.json', orient='records', indent=2, force_ascii=False)\n",
    "\n",
    "# 课程资源分析\n",
    "df_course_capacity.to_json('各学期课程开设数量与容量.json', orient='records', indent=2, force_ascii=False)\n",
    "df_resource_allocation.to_json('教学资源分配情况.json', orient='records', indent=2, force_ascii=False)\n",
    "df_course_demand.to_json('历年课程选课数据及影响因素.json', orient='records', indent=2, force_ascii=False)\n",
    "df_textbook.to_json('教材使用频率与评价.json', orient='records', indent=2, force_ascii=False)\n",
    "df_equipment_utilization.to_json('实验设备利用率数据.json', orient='records', indent=2, force_ascii=False)\n",
    "\n",
    "# 师资结构分析\n",
    "df_teacher_age_title.to_json('教师职称与年龄分布.json', orient='records', indent=2, force_ascii=False)\n",
    "df_teacher_workload.to_json('教师教学工作量统计.json', orient='records', indent=2, force_ascii=False)\n",
    "df_teacher_research_teaching.to_json('教师科研成果与教学评价.json', orient='records', indent=2, force_ascii=False)\n",
    "df_teacher_features.to_json('教师特征及历史教学评价数据.json', orient='records', indent=2, force_ascii=False)\n",
    "df_teacher_training.to_json('教师培训参与情况.json', orient='records', indent=2, force_ascii=False)\n",
    "\n",
    "print(\"所有数据生成完成！\")"
   ],
   "id": "b4b87b28e05a9c22",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "生成教学质量分析数据...\n",
      "生成学生学业分析数据...\n",
      "生成课程资源分析数据...\n",
      "生成师资结构分析数据...\n",
      "保存数据到JSON文件...\n",
      "所有数据生成完成！\n"
     ]
    }
   ],
   "execution_count": 2
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
